﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../assets/css/yui-cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/x-icon" href="../assets/favicon.ico">
    <script src="../assets/js/yui-source.js"></script>
	<title>SoundJS v1.0.0 API Documentation : PlayPropsConfig</title>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
            
                <h1><a href="http://createjs.site/soundjs"><img src="../assets/docs-icon-SoundJS.png" title="SoundJS"></a></h1>
            
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Documentation for: 1.0.0</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
    <h2 class="off-left">APIs</h2>
    <div id="api-tabview" class="tabview">
        <ul class="tabs">
            <li><a href="#api-classes">Classes</a></li>
        </ul>

        <div id="api-tabview-filter">
            <input type="search" id="api-filter" placeholder="Type to filter APIs">
        </div>

        <div id="api-tabview-panel">
            <ul id="api-classes" class="apis classes">
            
                <li><a href="AbstractPlugin.html">AbstractPlugin</a></li>
            
                <li><a href="AbstractSoundInstance.html">AbstractSoundInstance</a></li>
            
                <li><a href="AudioSprite.html">AudioSprite</a></li>
            
                <li><a href="CordovaAudioLoader.html">CordovaAudioLoader</a></li>
            
                <li><a href="CordovaAudioPlugin.html">CordovaAudioPlugin</a></li>
            
                <li><a href="CordovaAudioSoundInstance.html">CordovaAudioSoundInstance</a></li>
            
                <li><a href="ErrorEvent.html">ErrorEvent</a></li>
            
                <li><a href="Event.html">Event</a></li>
            
                <li><a href="EventDispatcher.html">EventDispatcher</a></li>
            
                <li><a href="FlashAudioLoader.html">FlashAudioLoader</a></li>
            
                <li><a href="FlashAudioPlugin.html">FlashAudioPlugin</a></li>
            
                <li><a href="FlashAudioSoundInstance.html">FlashAudioSoundInstance</a></li>
            
                <li><a href="HTMLAudioPlugin.html">HTMLAudioPlugin</a></li>
            
                <li><a href="HTMLAudioSoundInstance.html">HTMLAudioSoundInstance</a></li>
            
                <li><a href="HTMLAudioTagPool.html">HTMLAudioTagPool</a></li>
            
                <li><a href="PlayPropsConfig.html">PlayPropsConfig</a></li>
            
                <li><a href="Sound.html">Sound</a></li>
            
                <li><a href="SoundJS.html">SoundJS</a></li>
            
                <li><a href="Utility%20Methods.html">Utility Methods</a></li>
            
                <li><a href="WebAudioLoader.html">WebAudioLoader</a></li>
            
                <li><a href="WebAudioPlugin.html">WebAudioPlugin</a></li>
            
                <li><a href="WebAudioSoundInstance.html">WebAudioSoundInstance</a></li>
            
            </ul>

            <ul id="api-modules" class="apis modules">
            
                <li><a href="../modules/CreateJS.html">CreateJS</a></li>
            
                <li><a href="../modules/SoundJS.html">SoundJS</a></li>
            
            </ul>
        </div>
    </div>
</div>

            </div>
        </div>
        <div class="yui3-u-3-4">
            <div id="api-options">
        Show:
        <label for="api-show-inherited">
            <input type="checkbox" id="api-show-inherited" checked="">
            Inherited
        </label>

        <label for="api-show-protected">
            <input type="checkbox" id="api-show-protected">
            Protected
        </label>

        <label for="api-show-private">
            <input type="checkbox" id="api-show-private">
            Private
        </label>
        <label for="api-show-deprecated">
            <input type="checkbox" id="api-show-deprecated">
            Deprecated
        </label>

    </div>
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
                        <h1>PlayPropsConfig Class</h1>
<div class="box meta">
    

    

    
        <div class="foundat">
            Defined in: <a href="../files/soundjs_data_PlayPropsConfig.js.html#l39"><code>PlayPropsConfig:39</code></a>
        </div>
    

    
        
            Module: <a href="../modules/SoundJS.html">SoundJS</a>
        
    

    
        <p>Available since 0.6.1</p>
    
</div>



<div class="box intro">
    <p>A class to store the optional play properties passed in <a href="Sound.html#method_play" class="crosslink">play</a> and
<a href="AbstractSoundInstance.html#method_play" class="crosslink">play</a> calls.</p>
<p>Optional Play Properties Include:</p>
<ul>
<li>interrupt - How to interrupt any currently playing instances of audio with the same source,
if the maximum number of instances of the sound are already playing. Values are defined as <code>INTERRUPT_TYPE</code>
constants on the Sound class, with the default defined by <a href="Sound.html#property_defaultInterruptBehavior" class="crosslink">defaultInterruptBehavior</a>.</li>
<li>delay - The amount of time to delay the start of audio playback, in milliseconds.</li>
<li>offset - The offset from the start of the audio to begin playback, in milliseconds.</li>
<li>loop - How many times the audio loops when it reaches the end of playback. The default is 0 (no
loops), and -1 can be used for infinite playback.</li>
<li>volume - The volume of the sound, between 0 and 1. Note that the master volume is applied
against the individual volume.</li>
<li>pan - The left-right pan of the sound (if supported), between -1 (left) and 1 (right).</li>
<li>startTime - To create an audio sprite (with duration), the initial offset to start playback and loop from, in milliseconds.</li>
<li>duration - To create an audio sprite (with startTime), the amount of time to play the clip for, in milliseconds.</li>
</ul>

<h4>Example</h4>

<pre class="code prettyprint"><code>var props = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5})
createjs.Sound.play("mySound", props);
// OR
mySoundInstance.play(props);</code></pre>

</div>


    <div class="constructor">
        <h2>Constructor</h2>
        <div id="method_PlayPropsConfig" class="method item">
    <h3 class="name"><code>PlayPropsConfig</code></h3>

    
        <span class="paren">()</span>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l39"><code>PlayPropsConfig:39</code></a>
        
        </p>


        

        
            <p>Available since 0.6.1</p>
        
    </div>

    <div class="description">
        
    </div>

    

    

    
</div>

    </div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

        
            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
        
        
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
        
        
        
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

            
                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                        
                            <li class="index-item method">
                                <a href="#method_create">create</a>

                                
                                    <span class="flag static">static</span>
                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_set">set</a>

                                
                                
                            </li>
                        
                    </ul>
                </div>
            

            
                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties">
                        
                            <li class="index-item property">
                                <a href="#property_delay">delay</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_duration">duration</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_interrupt">interrupt</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_loop">loop</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_offset">offset</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_pan">pan</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_startTime">startTime</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_volume">volume</a>

                                
                                
                            </li>
                        
                    </ul>
                </div>
            

            

            
        </div>

        
            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

                
                    <div id="method_create" class="method item">
    <h3 class="name"><code>create</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>value</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    
        <span class="returns-inline">
            <span class="type"><a href="PlayPropsConfig.html" class="crosslink">PlayPropsConfig</a></span>
        </span>
    

    

    

    

    
        <span class="flag static">static</span>
    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l147"><code>create:147</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Creates a PlayPropsConfig from another PlayPropsConfig or an Object.</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">value</code>
                        <span class="type"><a href="PlayPropsConfig.html" class="crosslink">PlayPropsConfig</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
                    

                    

                    <div class="param-description">
                        <p>The play properties</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    
        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                
                    
                        <span class="type"><a href="PlayPropsConfig.html" class="crosslink">PlayPropsConfig</a></span>:
                    
                
            </div>
        </div>
    

    
</div>

                
                    <div id="method_set" class="method item">
    <h3 class="name"><code>set</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>props</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    
        <span class="returns-inline">
            <span class="type"><a href="PlayPropsConfig.html" class="crosslink">PlayPropsConfig</a></span>
        </span>
    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l168"><code>set:168</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Provides a chainable shortcut method for setting a number of properties on the instance.</p>
<h4>Example</h4>

<pre class="code prettyprint"><code> var PlayPropsConfig = new createjs.PlayPropsConfig().set({loop:-1, volume:0.7});</code></pre>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">props</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
                    

                    

                    <div class="param-description">
                        <p>A generic object containing properties to copy to the PlayPropsConfig instance.</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    
        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                
                    
                        <span class="type"><a href="PlayPropsConfig.html" class="crosslink">PlayPropsConfig</a></span>:
                    
                    <p>Returns the instance the method is called on (useful for chaining calls.)</p>

                
            </div>
        </div>
    

    
</div>

                
            </div>
        

        
            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

                
                    <div id="property_delay" class="property item">
    <h3 class="name"><code>delay</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l84"><code>delay:84</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The amount of time to delay the start of audio playback, in milliseconds.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property_duration" class="property item">
    <h3 class="name"><code>duration</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l134"><code>duration:134</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Used to create an audio sprite (with startTime), the amount of time to play the clip for, in milliseconds.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property_interrupt" class="property item">
    <h3 class="name"><code>interrupt</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l73"><code>interrupt:73</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>How to interrupt any currently playing instances of audio with the same source,
if the maximum number of instances of the sound are already playing. Values are defined as
<code>INTERRUPT_TYPE</code> constants on the Sound class, with the default defined by
<a href="Sound.html#property_defaultInterruptBehavior" class="crosslink">defaultInterruptBehavior</a>.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property_loop" class="property item">
    <h3 class="name"><code>loop</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l100"><code>loop:100</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>How many times the audio loops when it reaches the end of playback. The default is 0 (no
loops), and -1 can be used for infinite playback.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property_offset" class="property item">
    <h3 class="name"><code>offset</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l92"><code>offset:92</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The offset from the start of the audio to begin playback, in milliseconds.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property_pan" class="property item">
    <h3 class="name"><code>pan</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l118"><code>pan:118</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The left-right pan of the sound (if supported), between -1 (left) and 1 (right).</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property_startTime" class="property item">
    <h3 class="name"><code>startTime</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l126"><code>startTime:126</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Used to create an audio sprite (with duration), the initial offset to start playback and loop from, in milliseconds.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property_volume" class="property item">
    <h3 class="name"><code>volume</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/soundjs_data_PlayPropsConfig.js.html#l109"><code>volume:109</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The volume of the sound, between 0 and 1. Note that the master volume is applied
against the individual volume.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
            </div>
        

        

        
    </div>
</div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
